home *** CD-ROM | disk | FTP | other *** search
- 100 'Investment Yield ("INVYIELD")
- 110 CLS
- 120 COLOR 0,15 : PRINT "Investment Yield" : COLOR 15,0
- 130 DEFDBL A-Z
- 140 PCTFMT$ = "###.##_%"
- 150 PRINT : PRINT
- 160 PRINT "Do not enter dollar signs or commas"
- 170 PRINT
- 180 ' Let user enter data
- 190 INPUT "Purchase price of investment: ", PV
- 200 INPUT "Value of investment at end of term: ", FV
- 210 INPUT "Income per period: ", PMT
- 220 INPUT "Total number of periods: ", NPERIODS
- 230 INPUT "Number of income receipts per year: ", NPY
- 240 INPUT "Annual interest rate (in percent): ", AR
- 250 ' Find present value of income receipts
- 260 PR = (1 + AR / 100) ^ (1 / NPY) - 1
- 270 IF PR <> 0 THEN VALUEINCOME = (PMT / PR) * (1 - (1 + PR) ^ -NPERIODS) ELSE VALUEINCOME = NPERIODS * PMT
- 280 ' Find total future value
- 290 TOTALFV = VALUEINCOME * (1 + PR) ^ NPERIODS + FV
- 300 ' Find rate of return per period
- 310 PY = (TOTALFV / PV) ^ (1 / NPERIODS) - 1
- 320 ' Convert to annual rate of return
- 330 AY = 100 * ( (1 + PY) ^ NPY - 1)
- 340 PRINT
- 350 PRINT "Annual rate of return: "; USING PCTFMT$; AY
- 360 END